#pragma once
#include "log/channel.hpp"
#include "log/message.hpp"
#include "log/formatter.hpp"
#include <string>

namespace JHCPP
{
	namespace log
	{
		class CFormattingChannel : public CChannel
		{
		public:
			CFormattingChannel();
			CFormattingChannel(CFormatter* pFormatter);
			CFormattingChannel(CFormatter* pFormatter, CChannel* pChannel);


			void setFormatter(CFormatter* pFormatter);
			CFormatter* getFormatter() const;

			void setChannel(CChannel* pChannel);
			CChannel* getChannel() const;

			void log(const CMessage& msg);

			void setProperty(const std::string& name, const std::string& value);
	
			void open();
			void close();

		protected:
			~CFormattingChannel();

		private:
			CFormatter* m_pFormatter;
			CChannel*	m_pChannel;
		};
	}//end of namespace log
}//end of namespace JHCPP
